package com.google.guava.utilities;

import java.util.concurrent.TimeUnit;

/**
 * @author fuc
 * @create 2020-08-22
 */
public class ElapsedExample {

  public static void main(String[] args) throws InterruptedException {
    process("1234");
  }

  private static void process(String orderNo) throws InterruptedException {
    System.out.printf("start process the oder %s\n", orderNo);
    long startTime = System.nanoTime();
    TimeUnit.SECONDS.sleep(1);

    System.out.printf(
        "The order %s process successful and elapsed %d\n",
        orderNo, (System.nanoTime() - startTime));
  }
}
